//
//  RMMHuiYuanKaPayTableViewCell.m
//  Romomo
//
//  Created by puman on 16/10/17.
//  Copyright © 2016年 mazegong. All rights reserved.
//

#import "RMMHuiYuanKaPayTableViewCell.h"

@implementation RMMHuiYuanKaPayTableViewCell
{
    UILabel *_label;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UIImageView*imageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 12, 40, 40)];
        imageView.image = [UIImage imageNamed:@"会员看支付@3x"];
        [self.contentView addSubview:imageView];
        
        UILabel *titleLable = [[UILabel alloc] initWithFrame:CGRectMake(imageView.right + 15, imageView.top, 90, kMaric)];
        titleLable.textColor = COLORFROMCODE(0x4A4A4A, 1);
        titleLable.font = kBFont(16);
        titleLable.text = @"会员卡支付";
        [self.contentView addSubview:titleLable];
        
        _label = [[UILabel alloc] initWithFrame:CGRectMake(titleLable.right , titleLable.top, kScreenWideth - titleLable.right - 60, kMaric)];
        _label.textColor = COLORFROMCODE(0xF95B45, 1);
        _label.font = kFont(12);
        _label.hidden = YES;
        [self.contentView addSubview:_label];

       _balanceLabel = [[UILabel alloc] initWithFrame:CGRectMake(imageView.right + 15, imageView.bottom - 15, kScreenWideth - imageView.right - 60, 15)];
        _balanceLabel.textColor = COLORFROMCODE(0x9B9B9B, 1);
        _balanceLabel.font = kFont(11);
        [self.contentView addSubview:_balanceLabel];

        _chongZhiBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _chongZhiBut.frame = CGRectMake(_balanceLabel.left, _balanceLabel.bottom + 8, 60, 28);
        _chongZhiBut.layer.cornerRadius = 14;
        _chongZhiBut.layer.masksToBounds = YES;
        _chongZhiBut.backgroundColor = kBasicColor;
        [_chongZhiBut setTitle:@"充值" forState:(UIControlStateNormal)];
        [_chongZhiBut setTitleColor:kWhiteColor forState:(UIControlStateNormal)];
        _chongZhiBut.titleLabel.font = kBFont(16);
        [self.contentView addSubview:_chongZhiBut];
        
        _selcetBut = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _selcetBut.frame = CGRectMake(kScreenWideth - kHalf, 0, kHalf, kHalf + kRow);
        [_selcetBut setImage:[UIImage imageNamed:@"不可选@3x"] forState:(UIControlStateNormal)];
        [self.contentView addSubview:_selcetBut];
    }
    return self;
}
- (void)setString:(NSString *)string{
    if (string.length) {
        _label.hidden = NO;
        _label.text = [NSString stringWithFormat:@"可为您节省%@元",string];
    } else {
        _label.hidden = YES;
    }
}
- (void)setBalance:(NSString *)balance{
    _balanceLabel.text = [NSString stringWithFormat:@"会员卡余额:%@",balance];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
